package com.zheng;


import com.zheng.bean.ConsumerComponent;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

public class Customer2Main {

    public static void main(String[] args) throws InterruptedException {
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
        context.start();
        ConsumerComponent consumerComponent=context.getBean(ConsumerComponent.class);
        while (true){
            consumerComponent.run();
            Thread.sleep(30);
        }
    }

    @Configuration
    @EnableDubbo
    @PropertySource("classpath:/dubbo-customer.properties")
    @ComponentScan("com.zheng.bean")
    static class ConsumerConfiguration{

    }
}
